package com.tengju.user.domain.model.sign;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum StarSignStepEnum {
    SEND_ALREADY(10,"邀约已发送"),
    SURVEY_ALREADY(20,"问卷调查已完成"),
    ACCOUNT_ALREADY(30,"支付身份认证已完成"),
    AUDIT_ALREADY(40,"数据审核已完成"),
    EXAM_ALREADY(45,"考试已完成"),
    SIGN_ALREADY(50,"电子签约已完成"),
    END(60,"结束"),
    TERMINATED(70,"已终止"),
    ;

    private int step;
    private String desc;

    StarSignStepEnum(int step, String desc) {
        this.step = step;
        this.desc = desc;
    }

    public static StarSignStepEnum getByStep(Integer code) {
        if (code == null) {
            return null;
        }
        return Arrays.stream(StarSignStepEnum.values()).filter(k->k.getStep() == code)
                .findFirst().orElse(null);
    }
}
